<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>配送信息</title>
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
    <meta content="" name="description">
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wap/app/base.css" type="text/css">
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wap/app/style.css" type="text/css">
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wap/app/style.css" type="text/css">
    <script src="<?php echo $this->staticUrl;?>plugins/jquery-1.10.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<?php echo $ak;?>"></script>
    <style>
        * {
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none; /*系统默认菜单被禁用*/
            -webkit-user-select: none; /*webkit浏览器*/
            -khtml-user-select: none; /*早期浏览器*/
            -moz-user-select: none; /*火狐*/
            -ms-user-select: none; /*IE10*/
            user-select: none;
        }
        body{
            background: #fff;
        }
        .wuliu{height: 350px;}
    </style>
</head>
<body>
<div class="wuliu">
    <div id="map" style="width:100%;height:100%;"></div>
</div>

<div class="log-cons">
    <?php if($Traces):?>
        <?php foreach ($Traces as $k => $v):?>
            <div class="log-conschange <?php if($k == 0):?>selected<?php endif;?>">
                <?php if($k == 0):?>
                    <img src="<?php echo $this->staticUrl;?>wap/img/png/yuan.png" alt="">
                <?php else:?>
                    <div class="readio"></div>
                <?php endif;?>
                <p><?php echo $v['status'];?></p>
                <label><?php echo $v['time'];?></label>
            </div>
        <?php endforeach;?>
    <?php endif;?>
</div>
</body>
</html>
<script type="text/javascript">
    var map = null;
    var bPoints = new Array();
    $(function(){
        var pt = new BMap.Point(<?php echo $shop_longitude;?>, <?php echo $shop_latitude;?>);//店铺坐标
        bPoints.push(pt); // 添加到百度坐标数组 用于自动调整缩放级别
        map = new BMap.Map("map");
        map.centerAndZoom(pt, 18);
        map.enableScrollWheelZoom();
        map.enableContinuousZoom();

        //收货人坐标
        var p1 = new BMap.Point(<?php echo $send_to_longitude;?>, <?php echo $send_to_latitude;?>);
        bPoints.push(p1); // 添加到百度坐标数组 用于自动调整缩放级别
        var myIcon = new BMap.Icon("<?php echo base_url('static/img/consumer.png');?>", new BMap.Size(50,50));
        var marker2 = new BMap.Marker(p1, {icon:myIcon});  // 创建标注
        map.addOverlay(marker2);
        //店铺坐标
        var myIcon = new BMap.Icon("<?php echo base_url('static/img/merchant.png');?>", new BMap.Size(50,50));
        var marker = new BMap.Marker(pt, {icon:myIcon});  // 创建标注
        map.addOverlay(marker);
        //配送员
        var p2 = new BMap.Point(<?php echo $delivery_longitude;?>, <?php echo $delivery_latitude;?>);
        bPoints.push(p2); // 添加到百度坐标数组 用于自动调整缩放级别
        var myIcon = new BMap.Icon("<?php echo base_url('static/img/courier.png');?>", new BMap.Size(50,50));
        var marker3 = new BMap.Marker(p2, {icon:myIcon});  // 创建标注
        map.addOverlay(marker3);
        setZoom(bPoints);
    });
    // 根据点的数组自动调整缩放级别
    function setZoom (bPoints) {
        var view = map.getViewport(eval(bPoints));
        var mapZoom = view.zoom;
        var centerPoint = view.center;
        map.centerAndZoom(centerPoint,mapZoom);
    }
</script>
